package com.aspose.cells;

class zxq extends zado {
   public zxq(zadj var1) {
      this.a = var1;
   }

   public int a(String[] var1) {
      int var3 = 1;
      int var2;
      switch(var1[0].charAt(var3)) {
      case '"':
         ++var3;

         for(var2 = var3; var3 < var1[0].length() && var1[0].charAt(var3) != '"'; ++var3) {
            ;
         }

         if (var3 - var2 >= 0) {
            String var9 = var1[0].substring(var2, var2 + (var3 - var2));
            this.a.a(var9);
         }
         break;
      case 'B':
         if (this.a.i.isBold()) {
            this.a.i.setBold(false);
         } else {
            this.a.i.setBold(true);
         }
         break;
      case 'E':
         if (this.a.i.getUnderline() == 2) {
            this.a.i.setUnderline(0);
         } else {
            this.a.i.setUnderline(2);
         }
         break;
      case 'I':
         if (this.a.i.isItalic()) {
            this.a.i.setItalic(false);
         } else {
            this.a.i.setItalic(true);
         }
         break;
      case 'K':
         if (var3 + 6 >= var1[0].length()) {
            throw new CellsException(6, "Invalid font color of the page header/footer");
         }

         try {
            int var4;
            if (var1[0].charAt(var3 + 3) != '+' && var1[0].charAt(var3 + 3) != '-') {
               var4 = com.aspose.cells.b.a.zo.a(var1[0].substring(var3 + 1, var3 + 1 + 2), 515);
               int var10 = com.aspose.cells.b.a.zo.a(var1[0].substring(var3 + 3, var3 + 3 + 2), 515);
               int var6 = com.aspose.cells.b.a.zo.a(var1[0].substring(var3 + 5, var3 + 5 + 2), 515);
               this.a.i.setColor(Color.fromArgb(var4, var10, var6));
            } else {
               var4 = com.aspose.cells.b.a.zo.a(var1[0].substring(var3 + 1, var3 + 1 + 2));
               double var5 = (double)((float)com.aspose.cells.b.a.zo.a(var1[0].substring(var3 + 3, var3 + 3 + 4)) / 100.0F);
               zakp var7 = new zakp(false);
               var7.a(4, var4);
               var7.a(var5);
               this.a.i.b = var7;
            }
         } catch (Exception var8) {
            this.a.i.setColor(Color.fromArgb(0, 0, 0));
         }

         var3 += 6;
         break;
      case 'S':
         if (this.a.i.isStrikeout()) {
            this.a.i.setStrikeout(false);
         } else {
            this.a.i.setStrikeout(true);
         }
         break;
      case 'U':
         if (this.a.i.getUnderline() == 1) {
            this.a.i.setUnderline(0);
         } else {
            this.a.i.setUnderline(1);
         }
         break;
      case 'X':
         if (this.a.i.isSuperscript()) {
            this.a.i.setSuperscript(false);
         } else {
            this.a.i.setSuperscript(true);
         }
         break;
      case 'Y':
         if (this.a.i.isSubscript()) {
            this.a.i.setSubscript(false);
         } else {
            this.a.i.setSubscript(true);
         }
         break;
      default:
         for(var2 = var3++; var3 < var1[0].length() && Character.isDigit(var1[0].charAt(var3)); ++var3) {
            ;
         }

         this.a.i.setSize(com.aspose.cells.b.a.zo.a(var1[0].substring(var2, var2 + (var3 - var2))));
         --var3;
      }

      var1[0] = var1[0].substring(var3 + 1);
      this.a.g = this.a.a;
      return 1;
   }
}
